import random

import pandas as pd

from mainapp import DataScanGetToReport


def do_autogenerate_report(h_lot_number, h_product_type, report_number, report_date,
                           customer_name, order_number, production_lot_number, specification_model,
                           lot_quantity, direction_angle, feeding_angle, frequency_range,
                           frequency_measurement_gap, customer_material_number, product_size,
                           appearance_sample_quantity, ma_accept, ma_reject, frequency_diff_limit,
                           frequency_diff_control, frequency_offset_degree, size_data_address, angle_data_address,
                           frequency_data_address,
                           df_data_address, output_excel_path):
    """
        h_lot_number,                       # 生产批次号
        h_product_type,                     # 产品类型
        report_number,                      # 报告编号
        report_date,                        # 报告日期
        customer_name,                      # 客户名称
        order_number,                       # 订单号码
        production_lot_number,              # 出货批次号
        specification_model,                # 规格型号
        lot_quantity,                       # 批量
        direction_angle,                    # 方向角度
        feeding_angle,                      # 投料角度
        frequency_range,                    # 频率范围
        frequency_measurement_gap,          # 频率测量间隙
        customer_material_number,           # 出货产品料号
        product_size                        # 产品尺寸
        appearance_sample_quantity          # 外观抽样数
        ma_accept                           # Ma-ACC
        ma_reject                           # Ma-REJ
        frequency_diff_limit                # △F规格值
        frequency_diff_control              # △F管控值
        size_data_address                   # 尺寸数据地址
        angle_data_address                  # 直角度数据地址
        frequency_data_address              # 频率数据地址
        df_data_address                     # △F数据地址
        output_excel_path:                  # 输出文件地址
    """

    header_information = DataScanGetToReport.HeaderInformationQuery(h_lot_number, h_product_type, report_number,
                                                                    report_date,
                                                                    customer_name, order_number, production_lot_number,
                                                                    specification_model,
                                                                    lot_quantity, direction_angle, feeding_angle,
                                                                    frequency_range,
                                                                    frequency_measurement_gap, customer_material_number,
                                                                    product_size,
                                                                    appearance_sample_quantity, ma_accept, ma_reject,
                                                                    frequency_diff_limit,
                                                                    frequency_diff_control, frequency_offset_degree)
    DataScanGetToReport.do_autogenerate_report(header_information, size_data_address, angle_data_address,
                                               frequency_data_address,
                                               df_data_address, output_excel_path)
